<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>插件 | 学习笔记</title><meta name="author" content="lzoxun"><meta name="copyright" content="lzoxun"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="npm 插件puer 轻松开起本地服务器  123npm install puer -g# 直接使用puer --port xxxx  nodemon node 服务器改动时自动重启服务  123npm install nodemon -g# 直接使用nodemon server.js  apidoc 根据指定注释格式生成 api 文档  官网 1234567891011121314151617n">
<meta property="og:type" content="article">
<meta property="og:title" content="插件">
<meta property="og:url" content="http://example.com/2023/07/22/other/other-plugin/index.html">
<meta property="og:site_name" content="学习笔记">
<meta property="og:description" content="npm 插件puer 轻松开起本地服务器  123npm install puer -g# 直接使用puer --port xxxx  nodemon node 服务器改动时自动重启服务  123npm install nodemon -g# 直接使用nodemon server.js  apidoc 根据指定注释格式生成 api 文档  官网 1234567891011121314151617n">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:published_time" content="2023-07-22T07:14:09.685Z">
<meta property="article:modified_time" content="2023-07-22T07:14:09.685Z">
<meta property="article:author" content="lzoxun">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://example.com/2023/07/22/other/other-plugin/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":true,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '插件',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2023-07-22 15:14:09'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const now = new Date()
          const hour = now.getHours()
          const isNight = hour <= 6 || hour >= 18
          if (t === undefined) isNight ? activateDarkMode() : activateLightMode()
          else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>(()=>{
  const $loadingBox = document.getElementById('loading-box')
  const $body = document.body
  const preloader = {
    endLoading: () => {
      $body.style.overflow = ''
      $loadingBox.classList.add('loaded')
    },
    initLoading: () => {
      $body.style.overflow = 'hidden'
      $loadingBox.classList.remove('loaded')
    }
  }

  preloader.initLoading()
  window.addEventListener('load',() => { preloader.endLoading() })

  if (false) {
    document.addEventListener('pjax:send', () => { preloader.initLoading() })
    document.addEventListener('pjax:complete', () => { preloader.endLoading() })
  }
})()</script><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="学习笔记"><span class="site-name">学习笔记</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">插件</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2023-07-22T07:14:09.685Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-07-22T07:14:09.685Z" title="更新于 2023-07-22 15:14:09">2023-07-22</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="插件"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="npm-插件"><a href="#npm-插件" class="headerlink" title="npm 插件"></a>npm 插件</h2><h3 id="puer"><a href="#puer" class="headerlink" title="puer"></a>puer</h3><blockquote>
<p>轻松开起本地服务器</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npm install puer -g</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">直接使用</span></span><br><span class="line">puer --port xxxx</span><br></pre></td></tr></table></figure>

<h3 id="nodemon"><a href="#nodemon" class="headerlink" title="nodemon"></a>nodemon</h3><blockquote>
<p>node 服务器改动时自动重启服务</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npm install nodemon -g</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">直接使用</span></span><br><span class="line">nodemon server.js</span><br></pre></td></tr></table></figure>

<h3 id="apidoc"><a href="#apidoc" class="headerlink" title="apidoc"></a>apidoc</h3><blockquote>
<p>根据指定注释格式生成 api 文档</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://apidocjs.com/#install">官网</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">npm install apidoc -g</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">注释格式</span></span><br><span class="line">/**</span><br><span class="line"> * @api &#123;get&#125; /user/:id Request User information</span><br><span class="line"> * @apiName GetUser</span><br><span class="line"> * @apiGroup User</span><br><span class="line"> * </span><br><span class="line"> * @apiParam &#123;Number&#125; id Users unique ID.</span><br><span class="line"> * </span><br><span class="line"> * @apiSuccess &#123;String&#125; firstname Firstname of the User.</span><br><span class="line"> * @apiSuccess &#123;String&#125; lastname  Lastname of the User.</span><br><span class="line"> */</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">直接使用 -i(生成文档的文件夹) -o(输出文件夹)</span></span><br><span class="line">apidoc -i myapp/ -o apidoc/ -t mytemplate/</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>根目录下 apidoc.json 全局配置</p>
<figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//apidoc.json</span></span><br><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">    <span class="attr">&quot;name&quot;</span><span class="punctuation">:</span> <span class="string">&quot;example&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;version&quot;</span><span class="punctuation">:</span> <span class="string">&quot;0.1.0&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;description&quot;</span><span class="punctuation">:</span> <span class="string">&quot;apiDoc basic example&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;title&quot;</span><span class="punctuation">:</span> <span class="string">&quot;Custom apiDoc browser title&quot;</span><span class="punctuation">,</span></span><br><span class="line">    <span class="attr">&quot;url&quot;</span><span class="punctuation">:</span> <span class="string">&quot;https://api.github.com/v1&quot;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure>

<h3 id="bower"><a href="#bower" class="headerlink" title="bower"></a>bower</h3><blockquote>
<p>第三方插件下载工具,也是一个包管理器</p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npm install bower -g</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">直接使用</span></span><br><span class="line">bower install xxxx</span><br></pre></td></tr></table></figure>

<h3 id="json-server-生成-REST-API"><a href="#json-server-生成-REST-API" class="headerlink" title="json-server 生成 REST API"></a>json-server 生成 REST API</h3><blockquote>
<p>快速生成模拟可访问<strong>REST</strong> API 接口,post 请求时配置文件自动添加请求数据记录,并且每个接口都能使用 GET、POST、PUT(更新)、DELETE(删除)请求</p>
</blockquote>
<p>REST API</p>
<ul>
<li>同一个请求路径可以进行多个操作</li>
<li>请求方式可以可以用到 GET、PPST、PUT、DELETE</li>
<li>浏览器的运行动作 post、get、put、delete 与 CRUD 统一<ul>
<li>新增 (create，使用 POST )</li>
<li>读取 (read，使用 GET )</li>
<li>更新 (update，使用 PUT )</li>
<li>删除 (destroy，使用 DELETE)</li>
</ul>
</li>
</ul>
<p>非 REST API</p>
<ul>
<li>请求方式与 CRUD 无关</li>
<li>一个路径只对应一个操作</li>
<li>一般只用 GET&#x2F;POST</li>
</ul>
<p><a target="_blank" rel="noopener" href="https://github.com/typicode/json-server#getting-started">github 地址</a></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">npm install -g json-server</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">根目录创建 db.json 配置接口数据</span></span><br><span class="line">&#123;</span><br><span class="line">  &quot;posts&quot;: [</span><br><span class="line">    &#123; &quot;id&quot;: 1, &quot;title&quot;: &quot;json-server&quot;, &quot;author&quot;: &quot;typicode&quot; &#125;</span><br><span class="line">  ],</span><br><span class="line">  &quot;comments&quot;: [</span><br><span class="line">    &#123; &quot;id&quot;: 1, &quot;body&quot;: &quot;some comment&quot;, &quot;postId&quot;: 1 &#125;</span><br><span class="line">  ],</span><br><span class="line">  &quot;profile&quot;: &#123; &quot;name&quot;: &quot;typicode&quot; &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">生成接口并监听</span></span><br><span class="line">json-server --watch db.json</span><br></pre></td></tr></table></figure>

<h3 id="vuex-persistedstate"><a href="#vuex-persistedstate" class="headerlink" title="vuex-persistedstate"></a>vuex-persistedstate</h3><blockquote>
<p>vuex 持久化，<code>nuxt</code></p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">import createPersistedState from &quot;vuex-persistedstate&quot;</span><br><span class="line"></span><br><span class="line">const store = new Vuex.Store(&#123;</span><br><span class="line">    plugins: [createPersistedState()]</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>

<h3 id="vconsole"><a href="#vconsole" class="headerlink" title="vconsole"></a>vconsole</h3><blockquote>
<p><a target="_blank" rel="noopener" href="https://www.npmjs.com/package/vconsole">移动端的控制台</a></p>
</blockquote>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">npm install vconsole -D</span><br><span class="line"></span><br><span class="line">import vConsole from &#x27;vconsole&#x27;</span><br><span class="line">Vue.prototype.$vConsole = new vConsole();</span><br></pre></td></tr></table></figure>

<h3 id="spy-debugger-移动真机调试"><a href="#spy-debugger-移动真机调试" class="headerlink" title="spy-debugger 移动真机调试"></a>spy-debugger 移动真机调试</h3><p>已经废弃</p>
<p>1、安装<a target="_blank" rel="noopener" href="https://github.com/wuchangming/spy-debugger">github 入口</a></p>
<p>集成weinre</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install spy-<span class="keyword">debugger</span> -g</span><br></pre></td></tr></table></figure>

<p>2、命令行输入 spy-debugger<br>3、手机与电脑连接同一个局域网，根据提示 找到手机的 WiFi 长按 -&gt; 修改网络 -&gt; 显示高级 -&gt; 代理 -&gt;手动<br>4、对应主机名与端口 保存<br>5、在生成的网址中调试手机访问的页面</p>
<h3 id="weiner"><a href="#weiner" class="headerlink" title="weiner"></a>weiner</h3><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">npm install weinre -g</span><br><span class="line"></span><br><span class="line">启动 weinre --httpPort <span class="number">8082</span> --boundHost <span class="number">192.168</span><span class="number">.4</span><span class="number">.123</span></span><br><span class="line"></span><br><span class="line">浏览器打开 <span class="attr">http</span>:<span class="comment">//192.168.4.123:8082</span></span><br><span class="line"></span><br><span class="line">要调试的页面添加 &lt;script src=<span class="string">&quot;http://192.168.4.123:8082/target/target-script-min.js#anonymous&quot;</span>&gt;&lt;/script&gt;</span><br></pre></td></tr></table></figure>
<p>其他工具 vConsole、Charles</p>
<h3 id="内网穿透-端口映射工具"><a href="#内网穿透-端口映射工具" class="headerlink" title="内网穿透 端口映射工具"></a>内网穿透 端口映射工具</h3><blockquote>
<p>内网穿透,反向代理 大概意思是将您的本地主机公开到外网，公共端点和本地运行的 Web 服务器之间建立一个安全的通道，便于测试和共享</p>
</blockquote>
<p><a target="_blank" rel="noopener" href="https://www.npmjs.com/package/localtunnel">localtunnel</a></p>
<h4 id="安装及使用"><a href="#安装及使用" class="headerlink" title="安装及使用"></a>安装及使用</h4><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">npm install -g localtunnel</span><br><span class="line">lt --port &lt;要映射的端口&gt;</span><br><span class="line">lt --subdomain &lt;个性前缀&gt; --port &lt;要映射的端口&gt;</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">前缀不能太简单,出现tunnel server offline: Request failed with status code 403, retry 1s</span></span><br><span class="line"><span class="meta prompt_"></span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">本地开启服务 localhost:&lt;被映射的端口&gt;,访问生成的地址就能访问这个本地服务了</span></span><br></pre></td></tr></table></figure>

<h4 id="其他类似工具推荐"><a href="#其他类似工具推荐" class="headerlink" title="其他类似工具推荐"></a>其他类似工具推荐</h4><p>花生壳、PubYun、NoIP、DynDNS、Ngrok、Tunnel、pagekite 等</p>
<h3 id="乱七八糟小插件"><a href="#乱七八糟小插件" class="headerlink" title="乱七八糟小插件"></a>乱七八糟小插件</h3><ul>
<li><a target="_blank" rel="noopener" href="https://www.npmjs.com/package/nprogress">nprogress</a> 路由跳转上方出现进度条</li>
<li><a target="_blank" rel="noopener" href="https://www.npmjs.com/package/fastclick">fastclick</a> 解决移动端 click 300ms 延迟问题</li>
</ul>
<hr>
<h2 id="web-常用插件"><a href="#web-常用插件" class="headerlink" title="web 常用插件"></a>web 常用插件</h2><h3 id=""><a href="#" class="headerlink" title=""></a></h3><ul>
<li><a target="_blank" rel="noopener" href="https://www.cnblogs.com/cjrfan/p/9154539.html">日期时间(Day.js)</a></li>
</ul>
<h2 id="jQuery-插件"><a href="#jQuery-插件" class="headerlink" title="jQuery 插件"></a>jQuery 插件</h2><h3 id="fullpage-js"><a href="#fullpage-js" class="headerlink" title="fullpage.js"></a>fullpage.js</h3><blockquote>
<p>基于 jQuery 的全屏特效插件 <a target="_blank" rel="noopener" href="http://fullpage.81hu.com/">fullpage 官网</a> <a target="_blank" rel="noopener" href="https://www.bilibili.com/video/BV1Ks411V7Kg?p=49">bilibili 视频</a></p>
</blockquote>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line">bower install fullpage.<span class="property">js</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 1、引入jQuery、fullpage.css、fullpage.js</span></span><br><span class="line"><span class="comment">// 2、指定全屏结构标签</span></span><br><span class="line">&lt;div id=<span class="string">&quot;fullpage&quot;</span>&gt;</span><br><span class="line">    <span class="language-xml"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>Some section<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line">    <span class="language-xml"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>Some section<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line">    <span class="language-xml"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>Some section<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line">    <span class="language-xml"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;section&quot;</span>&gt;</span>Some section<span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line">&lt;/div&gt;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 3、js操作配置</span></span><br><span class="line">$(<span class="variable language_">document</span>).<span class="title function_">ready</span>(<span class="keyword">function</span>(<span class="params"></span>)&#123;</span><br><span class="line">    $(<span class="string">&#x27;#fullpage&#x27;</span>).<span class="title function_">fullpage</span>(&#123;</span><br><span class="line">       <span class="comment">//xxxx</span></span><br><span class="line">       <span class="comment">//在当前屏幕离开之前执行下面方法</span></span><br><span class="line">       <span class="attr">onLeave</span>: <span class="keyword">function</span>(<span class="params">index,nextIndex,dir</span>)&#123;</span><br><span class="line">          <span class="comment">/*</span></span><br><span class="line"><span class="comment">            当前屏索引、下一屏幕索引、方向</span></span><br><span class="line"><span class="comment">            滚动全屏动画效果方案:</span></span><br><span class="line"><span class="comment">                给所有屏幕的动画元素加上自定义属性(mat)储存动画class</span></span><br><span class="line"><span class="comment">                触发改方法的时候去掉当前屏动画</span></span><br><span class="line"><span class="comment">                给nextIndex中有动画的添加动画</span></span><br><span class="line"><span class="comment">          */</span></span><br><span class="line">          <span class="comment">//清除动画</span></span><br><span class="line">          $(<span class="string">&#x27;[mat]&#x27;</span>).<span class="title function_">each</span>(<span class="keyword">function</span>(<span class="params">ind,ele</span>)&#123;</span><br><span class="line">              <span class="keyword">var</span> mat = $(element).<span class="title function_">attr</span>(<span class="string">&#x27;mat&#x27;</span>);</span><br><span class="line">              $(element).<span class="title function_">removeClass</span>(mat)</span><br><span class="line">          &#125;)</span><br><span class="line">          <span class="comment">//下屏添加动画,找到下一屏,找到屏中拥有amt属性的元素,遍历添加类</span></span><br><span class="line">          $(<span class="string">&#x27;#fullpage .section&#x27;</span>).<span class="title function_">eq</span>(nextIndex - <span class="number">1</span>).<span class="title function_">find</span>(<span class="string">&#x27;[amt]&#x27;</span>).<span class="title function_">each</span>(<span class="keyword">function</span>(<span class="params">addi,addele</span>)&#123;</span><br><span class="line">              $(addele).<span class="title function_">addClass</span>($(addele).<span class="title function_">attr</span>(<span class="string">&#x27;amt&#x27;</span>))</span><br><span class="line">          &#125;)</span><br><span class="line">       &#125;</span><br><span class="line">    &#125;)</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="http://example.com">lzoxun</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://example.com/2023/07/22/other/other-plugin/">http://example.com/2023/07/22/other/other-plugin/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://example.com" target="_blank">学习笔记</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/2023/07/22/other/other-other-issues/" title="其他问题"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">其他问题</div></div></a></div><div class="next-post pull-right"><a href="/2023/07/22/other/other-postmain/" title="postmain"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">postmain</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">lzoxun</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">108</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">1</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/liaozhongxun"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/liaozhongxun" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:869664233@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">这是我的文档</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#npm-%E6%8F%92%E4%BB%B6"><span class="toc-number">1.</span> <span class="toc-text">npm 插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#puer"><span class="toc-number">1.1.</span> <span class="toc-text">puer</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#nodemon"><span class="toc-number">1.2.</span> <span class="toc-text">nodemon</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#apidoc"><span class="toc-number">1.3.</span> <span class="toc-text">apidoc</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#bower"><span class="toc-number">1.4.</span> <span class="toc-text">bower</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#json-server-%E7%94%9F%E6%88%90-REST-API"><span class="toc-number">1.5.</span> <span class="toc-text">json-server 生成 REST API</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#vuex-persistedstate"><span class="toc-number">1.6.</span> <span class="toc-text">vuex-persistedstate</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#vconsole"><span class="toc-number">1.7.</span> <span class="toc-text">vconsole</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#spy-debugger-%E7%A7%BB%E5%8A%A8%E7%9C%9F%E6%9C%BA%E8%B0%83%E8%AF%95"><span class="toc-number">1.8.</span> <span class="toc-text">spy-debugger 移动真机调试</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#weiner"><span class="toc-number">1.9.</span> <span class="toc-text">weiner</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F-%E7%AB%AF%E5%8F%A3%E6%98%A0%E5%B0%84%E5%B7%A5%E5%85%B7"><span class="toc-number">1.10.</span> <span class="toc-text">内网穿透 端口映射工具</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%AE%89%E8%A3%85%E5%8F%8A%E4%BD%BF%E7%94%A8"><span class="toc-number">1.10.1.</span> <span class="toc-text">安装及使用</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%85%B6%E4%BB%96%E7%B1%BB%E4%BC%BC%E5%B7%A5%E5%85%B7%E6%8E%A8%E8%8D%90"><span class="toc-number">1.10.2.</span> <span class="toc-text">其他类似工具推荐</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%B9%B1%E4%B8%83%E5%85%AB%E7%B3%9F%E5%B0%8F%E6%8F%92%E4%BB%B6"><span class="toc-number">1.11.</span> <span class="toc-text">乱七八糟小插件</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#web-%E5%B8%B8%E7%94%A8%E6%8F%92%E4%BB%B6"><span class="toc-number">2.</span> <span class="toc-text">web 常用插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link"><span class="toc-number">2.1.</span> <span class="toc-text"></span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#jQuery-%E6%8F%92%E4%BB%B6"><span class="toc-number">3.</span> <span class="toc-text">jQuery 插件</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#fullpage-js"><span class="toc-number">3.1.</span> <span class="toc-text">fullpage.js</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-11/" title="win 11 set">win 11 set</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-gitbash/" title="git bash">git bash</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-wsl/" title="wsl">wsl</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/window/win-main/" title="window">window</a><time datetime="2023-07-22T07:14:09.700Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/07/22/web/%E5%85%BC%E5%AE%B9%E9%97%AE%E9%A2%98/" title="兼容问题">兼容问题</a><time datetime="2023-07-22T07:14:09.699Z" title="发表于 2023-07-22 15:14:09">2023-07-22</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By lzoxun</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script>function panguFn () {
  if (typeof pangu === 'object') pangu.autoSpacingPage()
  else {
    getScript('https://cdn.jsdelivr.net/npm/pangu/dist/browser/pangu.min.js')
      .then(() => {
        pangu.autoSpacingPage()
      })
  }
}

function panguInit () {
  if (false){
    GLOBAL_CONFIG_SITE.isPost && panguFn()
  } else {
    panguFn()
  }
}

document.addEventListener('DOMContentLoaded', panguInit)</script><div class="js-pjax"></div><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div class="no-result" id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/haruto.model.json"},"display":{"position":"right","width":100,"height":200,"right":300},"mobile":{"show":true}});</script></body></html>